package com.reny.ll.git.base_logic.utils

import android.annotation.SuppressLint
import android.content.Context
import android.net.ConnectivityManager
import com.reny.ll.git.core.App

class NetUtils {

    companion object{

        @SuppressLint("MissingPermission")
        fun isConn(context: Context = App.instance):Boolean{
            val manager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
            val networkInfo = manager.activeNetworkInfo

            // 判断网络情况
            if (networkInfo != null && networkInfo.isAvailable) {
                // 网络可用时的执行内容
                return true
            }
            return false
        }

    }

}